import upload from '@/utils/upload'
import request from '@/utils/request'
// 用户头像上传
export function uploadFile({
	filePath
}) {
	return upload({
		url: '/system/oss/upload',
		filePath
	})
}

// 预览文件
export function viewFile(fileId) {
	return request({
		url: '/app/view',
		method: 'get',
		params: {
			fileId: fileId || ''
		},
		responseType: 'blob'
	})
}

// 删除文件
export function deleteFile(fileId) {
	return request({
		url: `/system/oss/deleteByFileName/${fileId} `,
		method: 'get'
	})
}
